package cyy.example.com.facotry.model.db;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Property;

/**
 * Created by ChenYiYao on 2018/12/3.
 * des :
 */
@Entity
public class MessageModle extends BaseDbModel<MessageModle> {

    @Id(autoincrement = true)
    private Long id;

    /**
     * 具体的内容id，如任务对应任务id，企业相关的对应企业id
     */
    private String contentId;

    @NotNull
    String type; //类型

    @NotNull
    @Property
    String title; //标题

    @Property
    String content; //内容

    @Property
    long time; //时间

    @Property
    String extra;//额外字段

    @Generated(hash = 106235711)
    public MessageModle(Long id, String contentId, @NotNull String type,
            @NotNull String title, String content, long time, String extra) {
        this.id = id;
        this.contentId = contentId;
        this.type = type;
        this.title = title;
        this.content = content;
        this.time = time;
        this.extra = extra;
    }

    @Generated(hash = 105581400)
    public MessageModle() {
    }


    public String getContentId() {
        return this.contentId;
    }

    public void setContentId(String contentId) {
        this.contentId = contentId;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return this.content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getExtra() {
        return this.extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }


    @Override
    public String toString() {
        return "MessageModle{" +
                "id=" + id +
                ", contentId='" + contentId + '\'' +
                ", type='" + type + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", extra='" + extra + '\'' +
                '}';
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return this.id;
    }

    public long getTime() {
        return this.time;
    }

    public void setTime(long time) {
        this.time = time;
    }


    @Override
    public boolean isSame(MessageModle old) {
        return this == old;
    }

    @Override
    public boolean isDataContentSame(MessageModle old) {

        return this.id == old.id &&
                this.type.equals(old.type) &&
                this.time == old.time &&
                this.title.equals(old.title);
    }
}
